import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * Created by us on 2016/10/23.
 */
public class NewPicture {
    public void picture(){
        try{
            BufferedImage image = ImageIO.read(new File("data/scene4-1.png"));
            int width = image.getWidth();
            int height = image.getHeight();
            int []imageArray = new int[width*height];
            image.getRGB(0,0,width,height,imageArray,0,width);
            BufferedImage imageNew = new BufferedImage(width,height/2,BufferedImage.TYPE_4BYTE_ABGR);
            imageNew.setRGB(0,0,width,height/2,imageArray,0,width);
            File outFile = new File("cut.png");
            ImageIO.write(imageNew,"png",outFile);

        }catch (IOException e){
            e.printStackTrace();
        }
    }

}
